package abstrac;

public class TestDevice {
	public static void main(String[] args) {
		Person per=new Person();
		Telephone tel=new Telephone();
		Camera    cam=new Camera();
		Dvd       dvd=new Dvd();
		Mobile    mob=new Mobile();
		per.usedailup(tel);
		per.usetakephoto(cam);
		per.useplay(dvd);
		System.out.println();
		per.usemathine(mob);
	}

}
interface DailupMat{
	public void dailup();
}
interface CameraMat{
	public void takephoto();
}
interface PlayMat{
	public void play();
}
class Telephone implements DailupMat{

	@Override
	public void dailup() {
		System.out.println("use dailup function");		
	}
	
}
class Dvd implements PlayMat{

	@Override
	public void play() {
		System.out.println("use play function");		
	}
	
}
class Camera implements CameraMat{

	@Override
	public void takephoto() {
		System.out.println("use takephoto function");		
	}
	
}
class Mobile implements DailupMat,CameraMat,PlayMat{

	@Override
	public void play() {
		System.out.println("use play function");		
	}

	@Override
	public void takephoto() {
		System.out.println("use takephoto function");		
	}

	@Override
	public void dailup() {
		System.out.println("use dailup function");		
	}
	
}
 class Person {
	 public void usedailup(DailupMat tel){
	 //public void usedailup(Telephone tel){
		 tel.dailup();
	 }
	 public void useplay(PlayMat dvd){
//	 public void useplay(Dvd dvd){
         dvd.play();
	 }
	 public void usetakephoto(CameraMat cam){
//	 public void usetakephoto(Camera cam){
         cam.takephoto();
	 }
	 public void usemathine(Mobile mob){
		 mob.dailup();
		 mob.play();
         mob.takephoto();
	 }
}
